///layerModule(Module bottom, Module top)
//Layers the top module on the lower
//Overwrites the bottom data with top if top is not empty at the location
var bottom = argument0;
var top = argument1;

//Add top layer
for(var yyy = 0; yyy < array_height_2d(top.tiles); yyy++)
{
    for(var xxx = 0; xxx < array_length_2d(top.tiles, yyy); xxx++)
    {
        if(top.tiles[yyy, xxx] != 0)
        {
            setTile(xxx + top.tileX, yyy + top.tileY, top.tiles[yyy, xxx], bottom);
        }
    }
}